package com.farm.controller;


import com.farm.common.po.R;
import com.farm.domin.po.People;
import com.farm.service.impl.PeopleServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-04-07
 */
@RestController
@RequestMapping("/people")
@CrossOrigin
@RequiredArgsConstructor
@Api(tags = "用户接口")
public class PeopleController {
    private final PeopleServiceImpl peopleService;
    @ApiOperation("根据id查询人的信息")
    @GetMapping("/{id}")
    public R queryById(@PathVariable Integer id) {
        People people = peopleService.getById(id);
        return R.ok(people);
    }

}
